version: "3.7"

networks:
  postgres-network:
    driver: bridge
    ipam:
      config:
        - subnet: ${ORACLE_SUBNET}

services:
  oracle:
    container_name: oracle
    build:
      context: ./oracle
      dockerfile: Dockerfile
    working_dir: /opt/oracle
    restart: unless-stopped
    ports:
      - "1521:1521"
    volumes:
      - ${ORACLE_STORAGE_PATH}:/opt/oracle/oradata
      - ${ORACLE_BACKUP_PATH}:/opt/oracle/backup
      - ${ORACLE_LOG_PATH}:/opt/oracle/diag
      - ./sql:/docker-entrypoint-initdb.d/setup
    networks:
      postgres-network:
        ipv4_address: ${ORACLE_IP}
    environment:
      - ORACLE_SID=DEVCDB
      - ORACLE_PDB=DEVPDB1
      - ORACLE_PWD=sysPwd1
